/*
 +----------------------------------------------------------------------
 + Title        : 收货地址接口
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2023-07-08
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 收货地址接口
 +----------------------------------------------------------------------
*/
import request from '@/utils/httpRequest'

/**
 * 新增用户收货地址
 * 参数data包含以下数据
 *  param string name -------------------------------------------------必传,姓名
 *  param string mobile -----------------------------------------------必传,电话
 *  param string province_id ------------------------------------------必传,省
 *  param string city_id ----------------------------------------------必传,市
 *  param string district_id ------------------------------------------必传,区
 *  param string region -----------------------------------------------必传,区域
 *  param string address ----------------------------------------------必传,详细地址
 *  param string is_default -------------------------------------------必传,是否默认
 *
 * return json
 * author huwl
 */
export const reqAddUserDeliveryAddrAPI = async (data) => {
	return request({
		method: 'POST',
		url: 'userDeliveryAddr/add',
		data
	})
}
	
/**
 * 编辑用户收货地址
 * 参数data包含以下数据
 *  param int id ------------------------------------------------------必传,ID
 *  param string name -------------------------------------------------非必传,姓名
 *  param string mobile -----------------------------------------------非必传,电话
 *  param string province_id ------------------------------------------非必传,省
 *  param string city_id ----------------------------------------------非必传,市
 *  param string district_id ------------------------------------------非必传,区
 *  param string region -----------------------------------------------非必传,区域
 *  param string address ----------------------------------------------非必传,详细地址
 *  param string is_default -------------------------------------------非必传,是否默认
 *
 * return json
 * author huwl
 */
export const reqEditUserDeliveryAddrAPI = (data) => {
	return request({
		method: 'POST',
		url: 'userDeliveryAddr/edit',
		data
	})
}
	
/**
 * 删除用户收货地址
 * 参数data包含以下数据
 *  param int id ------------------------------------------------------必传,ID
 *
 * return json
 * author huwl
 */
export const reqDeleteUserDeliveryAddrAPI = (data) => {
	return request({
		method: 'POST',
		url: 'userDeliveryAddr/delete',
		data
	})
}
	
/**
 * 用户收货地址列表
 * 参数 params 包含以下数据
 *  param int status --------------------------------------------------非必传,状态
 *
 * return json
 * author huwl
 */
export const reqUserDeliveryAddrListAPI = (params) => {
	return request({
		method: 'GET',
		url: 'userDeliveryAddr/list',
		params
	})
}
	
